home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / vdisrc12 / vdiinpt1.s < prev    next >
Text File  |  1990-11-23  |  3KB  |  109 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* VDIFAST Public Domain VDI bindings.
  5. ;*
  6. ;*========================================================================
  7.  
  8.           .iif      !(^^macdef VContrl),.include  "vdimacro.s"
  9.           
  10. ;*************************************************************************
  11. ;*
  12. ;* Commonly-used input functions. 
  13. ;*  Mouse- and keyboard-related functions.
  14. ;*
  15. ;*************************************************************************
  16.  
  17. ;*------------------------------------------------------------------------
  18. ;* Set mouse form.
  19. ;*------------------------------------------------------------------------
  20.  
  21. _vsc_form::
  22.           .cargs    #8,.handle.w,.pform.l
  23.           link      a6,#0
  24.  
  25.           VContrl   #111,,,#37
  26.           
  27.           lea       -12(sp),sp
  28.           move.l    .pform(a6),-(sp)    ;* -> intin
  29.           pea       16(sp)              ;* -> contrl
  30.  
  31.           jmp       vdicall
  32.           
  33. ;*------------------------------------------------------------------------
  34. ;* Show cursor.
  35. ;*------------------------------------------------------------------------
  36.  
  37. _v_show_c::
  38.           .cargs    #8,.handle.w,.reset.w
  39.           link      a6,#0
  40.  
  41.           VContrl   #122,,,#1
  42.           
  43.           lea       -12(sp),sp
  44.           pea       .reset(a6)          ;* -> intin
  45.           pea       16(sp)              ;* -> contrl
  46.  
  47.           jmp       vdicall
  48.           
  49. ;*------------------------------------------------------------------------
  50. ;* Hide cursor.
  51. ;*------------------------------------------------------------------------
  52.  
  53. _v_hide_c::
  54.           .cargs    #8,.handle.w
  55.           link      a6,#0
  56.  
  57.           VContrl   #123
  58.           
  59.           pea       (sp)              ;* -> contrl
  60.  
  61.           jmp       vdicall
  62.  
  63. ;*------------------------------------------------------------------------
  64. ;* Sample mouse button state.
  65. ;*------------------------------------------------------------------------
  66.  
  67. _vq_mouse::
  68.           .cargs    #8,.handle.w,.status.l,.x.l,.y.l
  69.           link      a6,#-4              ;* Allocate ptsout[2].
  70.  
  71.           VContrl   #124
  72.           
  73.           pea       -4(a6)              ;* -> ptsout
  74.           move.l    .status(a6),-(sp)   ;* -> intout
  75.           subq.l    #8,sp
  76.           pea       16(sp)              ;* -> contrl
  77.  
  78.           moveq.l   #$73,d0
  79.           move.l    sp,d1
  80.           trap      #2
  81.  
  82.           move.l    .x(a6),a0           ;* Return mouse x
  83.           move.w    -4(a6),(a0)         ;* from ptsout[0].
  84.           move.l    .y(a6),a0           ;* Return mouse y
  85.           move.w    -2(a6),(a0)         ;* from ptsout[1].
  86.  
  87.           unlk      a6
  88.           rts
  89.   
  90. ;*------------------------------------------------------------------------
  91. ;* Sample keyboard state.
  92. ;*------------------------------------------------------------------------
  93.  
  94. _vq_key_s::
  95.           .cargs    #8,.handle.w,.status.l
  96.           link      a6,#0
  97.           
  98.           VContrl   #128
  99.           
  100.           subq.l    #4,sp               ;* -> ptsout
  101.           move.l    .status(a6),-(sp)   ;* -> intout
  102.           subq.l    #8,sp               ;* -> ptsin
  103.           pea       16(sp)              ;* -> contrl
  104.  
  105.           jmp       vdicall
  106.           
  107. ;*         end of code.
  108.  
  109.